// import Home from '@/pages/Home'
// import Mall from '@/pages/Mall'
// import Product from '@/pages/Product'
// import Cart from '@/pages/Cart'
// import Mine from '@/pages/Mine'
// import NotFound from '@/pages/NotFound'

// import NbTabbar from '@/components/NbTabbar'
import NbTabbar from '@/components/FixNbTabbar'

const Home = () => import('@/pages/Home')
const Mall = () => import('@/pages/Mall')
const Product = () => import('@/pages/Product')
const ProductList = () => import('@/pages/ProductList')
const Cart = () => import('@/pages/Cart')
const Mine = () => import('@/pages/Mine')
const NotFound = () => import('@/pages/NotFound')
const Login = () => import('@/pages/Login')

export default [{
  path: '/',
  redirect: '/home'
}, {
  path: '*',
  redirect: '/404'
}, {
  path: '/404',
  components: {
    default: NotFound
  }
}, {
  path: '/home',
  isTabbar: true,
  title: '首页',
  icon: '&#xe612;',
  components: {
    default: Home,
    tabbar: NbTabbar
  }
}, {
  path: '/mall',
  title: '商城',
  icon: '&#xe618;',
  isTabbar: true,
  components: {
    default: Mall,
    tabbar: NbTabbar
  },
  children: [{
    path: ':id',
    name: 'category',
    components: {
      default: ProductList
    }
  }]
}, {
  path: '/product/:id',
  name: 'product',
  components: {
    default: Product
  }
}, {
  path: '/cart',
  title: '购物车',
  icon: '&#xe61b;',
  isTabbar: true,
  components: {
    default: Cart,
    tabbar: NbTabbar
  },
  // 做一个标记，表示这个页面是需要有权限才能访问的，理解为需要登录才能访问
  meta: {
    isAuthRequired: true
  }
}, {
  path: '/mine',
  title: '我的',
  icon: '&#xe615;',
  isTabbar: true,
  components: {
    default: Mine,
    tabbar: NbTabbar
  },
  // 做一个标记，这里也是有权限的
  meta: {
    isAuthRequired: true
  }
}, {
  path: '/login',
  name: 'login',
  title: '登录',
  components: {
    default: Login
  }
}]
